<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex-direction</title>

    <style type="text/css">
        .flex-container {
            display: flex;
            width: 80vw;
            height: 60vh;
            border: 1px solid blue;
            margin: 25px auto;
        }
        
        .flex-item {
            width: 30%;
            height: 30%;
            text-align: center;
            font-size: 30px;
        }
        
        .flex-item:nth-child(1) {
            background: #6666fa;
        }
        
        .flex-item:nth-child(2) {
            background: #fa6666;
        }
        
        .flex-item:nth-child(3) {
            background: #fde768;
        }
        
        .first {
            flex-direction: row;
        }
        
        .second {
            flex-direction: row-reverse;
        }
        
        .third {
            flex-direction: column;
        }
        
        .fourth {
            flex-direction: column-reverse;
        }
    </style>

</head>

<body>

    <div class="flex-container first">
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
    </div>

    <div class="flex-container second">
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
    </div>

    <div class="flex-container third">
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
    </div>

    <div class="flex-container fourth">
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
    </div>

</body>

</html>